#include <iostream>
#include <cstring>
using namespace std;

class String{
  private:
    char str[31];
  public:
      void inputer(){
        cin >> str;
      }


      void ch_finder(){
        char ch;
        cin >> ch;
        bool found = false;
        char* p = str;
        size_t len_01 = strlen(str);
        for (size_t i = 0;i<len_01;++i){
          if (*p == ch){
            if (found){
              cout << " ";

            }
            cout << i;
            found = true;
          }
          p++ ;
        }
        if(!found){
          cout << "NULL";

        }
      }
};


int main(){
  String s;
  s.inputer();
  s.ch_finder();
  return 0;

}